﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace SmsUI
{
    public partial class RelayWin : DevExpress.XtraEditors.XtraForm
    {
        public string ReciveNum { get; set; }
        public string PortNum { get; set; }
        public string Content { get; set; }
        public RelayWin()
        {
            InitializeComponent();
            this.Load += new EventHandler(RelayWin_Load);

        }

        void RelayWin_Load(object sender, EventArgs e)
        {
            tbRecive.Text = ReciveNum;
            tbPortNum.Text = PortNum;
            tbContent.Text = Content;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbRecive.Text) || string.IsNullOrEmpty(tbPortNum.Text) ||
                string.IsNullOrEmpty(tbContent.Text))
            {
                XtraMessageBox.Show("请输入收件人、端口和内容！");
                return;
            }
            ReciveNum = tbRecive.Text;
            PortNum = tbPortNum.Text;
            Content = tbContent.Text;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}